import os
def write_job( self, submit=False ):
    os.chdir( self.output_dir )
    self.job.writeInput()
    inppath = self.jobname + '.inp'
    if self.using_lam_parameters == True:
        inp = open( inppath, 'r')
        lines = inp.readlines()
        inp.close()
        os.system( 'del ' + inppath )
        os.system( 'del ' + self.jobname + '.lck' )
        ind = lines.index('*End Part\n')
        lines.insert(ind+0,'*ELSET,elset=all_elements,generate\n')
        lines.insert(ind+1,'1,1000000,1\n')
        lines.insert(ind+2,'*Orientation, name=Ori-1, system=CYLINDRICAL\n')
        lines.insert(ind+3,'          0.,           0.,           0.,           0.,           0.,           1.\n')
        lines.insert(ind+4,'2, 0.\n')
        lines.insert(ind+5,'*SHELL GENERAL SECTION,ELSET=all_elements,ORIENTATION=Ori-1\n')
        ABD = self.laminate_obj.ABD
        ABDij = []
        for ccount in range(6):
            for lcount in range(ccount+1):
                ABDij.append( ABD[lcount][ccount] )        
        lines.insert(ind+6,'%f,%f,%f,%f,%f,%f,%f,%f\n' % tuple(ABDij[  :8]))
        lines.insert(ind+7,'%f,%f,%f,%f,%f,%f,%f,%f\n' % tuple(ABDij[8:16]))
        lines.insert(ind+8,'%f,%f,%f,%f,%f\n'          % tuple(ABDij[16: ]))
        if False:
            E   = self.laminate_obj.E
            lines.insert(ind+9,'*TRANSVERSE SHEAR STIFFNESS\n')
            lines.insert(ind+10,'%f,%f,%f\n' % (E[0][0],E[1][1],E[0][1]))
        inp = open( inppath, 'w')
        for line in lines:
           inp.write( line ) 
        inp.close()
    if submit:
        # the function below was commented because
        # the GUI writes another input file
        # overwriting the customized one
        #self.job.submit(consistencyChecking = OFF)
        os.system( 'abaqus job=%s input=%s' % (self.jobname, inppath) )
        self.check_completed( wait=True )
        self.read_walltime()
    os.chdir( self.tmp_dir )
